package cn.android666.mediacodecasynchronous.permission

import android.Manifest
import androidx.fragment.app.FragmentActivity

object PermissionUtil {

    fun registerForActivityResult(activity: FragmentActivity) {
        val permissions = mapOf(Manifest.permission.CAMERA to "摄像头")
        NormalPermissionUtil.setRequestPermissions(permissions)
        NormalPermissionUtil.registerForActivityResult(activity)
        StoragePermissionUtil.registerForActivityResult(activity)
    }

    fun requestPermission(activity: FragmentActivity, resultCallback: () -> Unit) {
        StoragePermissionUtil.requestPermission(activity) {
            NormalPermissionUtil.requestPermissions(resultCallback)
        }
    }
}